/*
 * TimedSolenoid.hpp
 *
 *  Created on: Feb 3, 2013
 *      Author: N500432
 */
#ifndef _TIMED_SOLENOID_H
#define _TIMED_SOLENOID_H

#include <WPILib.h>
#include "EntechSubsystem.h"

class TimedSolenoid : public EntechSubsystem
{
public:
	TimedSolenoid(UINT32 port);
	virtual ~TimedSolenoid();
	
	void Trigger( bool on );

	// Subsystem functions
	void DoTriggering(void);
	virtual void DoAutonomous(void);
	virtual void DoTeleop(void);
	virtual void DoTest(void);

protected:

private:
	enum State { kNotTriggering, kTriggeringOn, kTriggeringOff };
	Timer *m_timer;
	Solenoid *m_solenoid;
	State m_state;
	
	static const double c_timeout = 0.25;
};
#endif
